package cn.lijiajia3515.cairo.auth.controller;

import cn.lijiajia3515.cairo.core.business.DefaultBusiness;
import cn.lijiajia3515.cairo.core.exception.BusinessException;
import cn.lijiajia3515.cairo.domain.CairoAccount;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.security.PermitAll;

@RestController
@RequestMapping("")
public class MyApi {

	@GetMapping(value = {"/authentication"})
	@PreAuthorize("isAuthenticated()")
	public Object authentication(Authentication authentication) {
		return authentication;
	}

	@GetMapping("/account")
	public Object account(@AuthenticationPrincipal Object principal) {
		return principal;
	}



}
